import datetime
import calendar

def get_rang_date(t):
    today = datetime.date.today()
    if t == 1:
        start_date = today-datetime.timedelta(today.weekday())
        end_date = start_date - datetime.timedelta(1)
        start_date = end_date - datetime.timedelta(6)
    if t == 2:
        month_range = calendar.monthrange(today.year, today.month)[1]
        start_date = datetime.date(today.year, today.month, 1)
        end_date = datetime.date(today.year, today.month, month_range)
    if t == 3:
        start_date = datetime.date(today.year,1,1)
        end_date = datetime.date(today.year,12,31)
    return start_date,end_date